package com.das.mechanic_base.widget;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.util.Log;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;

import com.das.mechanic_base.R;
import com.das.mechanic_base.bean.even.CrmVpSumEvenBus;
import com.das.mechanic_base.bean.even.DeleteFriends;
import com.das.mechanic_base.bean.ground.CarIdinfoBean;
import com.das.mechanic_base.bean.ground.GroundAloneBean;
import com.das.mechanic_base.bean.ground.GroundPushBean;
import com.das.mechanic_base.bean.ground.HomeChangeMilesBean;
import com.das.mechanic_base.bean.ground.InputBean;
import com.das.mechanic_base.bean.ground.LivePlayBack;
import com.das.mechanic_base.bean.ground.MileOrTimeBean;
import com.das.mechanic_base.bean.ground.SaveCommunBean;
import com.das.mechanic_base.bean.ground.UpdateCarTypeBean;
import com.das.mechanic_base.bean.ground.VehicleInfoBean;
import com.das.mechanic_base.utils.X3StringUtils;
import com.das.mechanic_base.utils.X3ToastUtils;
import com.google.gson.Gson;
import com.hjq.permissions.OnPermissionCallback;
import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions;

import org.greenrobot.eventbus.EventBus;

import java.util.ArrayList;
import java.util.List;

/**
 * 作者：zhanglei on 2019/5/9 18:17
 * <p>
 * 邮箱：916256628@qq.com
 */
public class X3AndroidJAInteface {

    private Activity context;

    private WebView webView;

    private static final int SDK_PAY_FLAG = 1001;

    IOnCLickPushReport iOnCLickPushReport;

    IOnClickShareReport iOnClickShareReport;

    IOnClickReturnListener iOnClickReturnListener;

    public X3AndroidJAInteface(Activity context, WebView webView) {
        this.context = context;
        this.webView = webView;
    }

    @JavascriptInterface
    public void shareScreenWork(String json) {
        if (iOnShareWork != null) {
            iOnShareWork.iOnShareWork(json);
        }
    }

    /**
     * 跳转到录播回放
     * @param content
     */
    @JavascriptInterface
    public void jumpToLiveVideo(String content) {
        Log.e("SSSS","跳转录播:" + content);
        if (X3StringUtils.isEmpty(content)) {
            return;
        }
        LivePlayBack back = new Gson().fromJson(content, LivePlayBack.class);
        if (iOnLivePlayBack != null) {
            iOnLivePlayBack.iOnLivePlayBack(back.roomId);
        }
    }

    /**
     * 刷新
     */
    @JavascriptInterface
    public void refreshLoad() {
        if (iOnRefreshLoad != null) {
            iOnRefreshLoad.iOnRefreshLoad();
        }
    }

    /**
     * 编辑保养和维修计划
     * @param json
     */
    @JavascriptInterface
    public void showChangePlan(String json) {
        if (iOnEditPlan != null) {
            iOnEditPlan.iOnEditPlan(json);
        }
    }

    @JavascriptInterface
    public void showHeaderColor(String color) {
        if (iOnShowHeaderColor != null) {
            iOnShowHeaderColor.iOnShowHeaderColor(color);
        }
    }

    /**
     * 修改车辆信息通知前一个页面刷新
     */
    @JavascriptInterface
    public void updateVehicleInfo() {
        if (iOnUpdateVehicleInfo != null) {
            iOnUpdateVehicleInfo.iUpdateVehicleInfo();
        }
    }

    @JavascriptInterface
    public void updateWorkList(String json) {
        if (iOnUpdateWorkList != null) {
            iOnUpdateWorkList.iUpdateWorkList();
        }
    }

    /**
     * 输入框
     * @param content
     */
    @JavascriptInterface
    public void inputContentChange(String content) {
        if (X3StringUtils.isEmpty(content)) {
            return;
        }
        InputBean pushBean = new Gson().fromJson(content, InputBean.class);
        if (iOnInputContent != null) {
            iOnInputContent.iOnInputContent(pushBean);
        }
    }

    @JavascriptInterface
    public void nativeLeaveMsg(String jsonBean) {
        if (X3StringUtils.isEmpty(jsonBean)) {
            return;
        }

        SaveCommunBean saveCommunBean = new Gson().fromJson(jsonBean, SaveCommunBean.class);

        if (saveCommunBean == null) {
            return;
        }
        if (X3StringUtils.isEmpty(saveCommunBean.carowneruserCommunicationId)) {
            return;
        }
        if (iOnShowSaveCommun != null) {
            iOnShowSaveCommun.iOnShowSaveCommun(Integer.parseInt(saveCommunBean.carowneruserCommunicationId));
        }
    }

    /**
     * 车辆初检
     * @param jsonBean
     */
    @JavascriptInterface
    public void jumpToFirst(String jsonBean) {
        if (X3StringUtils.isEmpty(jsonBean)) {
            return;
        }
        if (iOnShowAlone != null) {
            iOnShowAlone.iOnShowAloneCar(jsonBean);
        }
    }

    /**
     * 车辆切割
     * @param jsonBean
     */
    @JavascriptInterface
    public void showCarPicCut(String jsonBean) {
        if (X3StringUtils.isEmpty(jsonBean)) {
            return;
        }
        GroundPushBean pushBean = new Gson().fromJson(jsonBean, GroundPushBean.class);
        if (iOnShowCarPicCut != null) {
            iOnShowCarPicCut.iOnShowCarPicCut(pushBean);
        }
    }

    /**
     * 传递carId 生成车辆码  用于关联车辆
     * @param jsonBean
     */
    @JavascriptInterface
    public void showCarBindInfo(String jsonBean) {
        if (X3StringUtils.isEmpty(jsonBean)) {
            return;
        }
        GroundPushBean pushBean = new Gson().fromJson(jsonBean, GroundPushBean.class);
        if (iOnShowCarBind != null) {
            iOnShowCarBind.iOnShowCarBindInfo(pushBean);
        }
    }

    /**
     * 双轨计算
     * @param jsonBean
     */
    @JavascriptInterface
    public void nativeToGetDueDate(String jsonBean) {
        if (X3StringUtils.isEmpty(jsonBean)) {
            return;
        }
        MileOrTimeBean mileOrTimeBean = new Gson().fromJson(jsonBean, MileOrTimeBean.class);
        if (iOnShowToDueDate != null) {
            iOnShowToDueDate.iOnShowGetToDueDate(mileOrTimeBean);
        }
    }

    /**
     * 车辆详情里面的调用车辆品牌 车款 和 出厂时间
     * @param jsonBean
     */
    @JavascriptInterface
    public void showVehicleInfo(String jsonBean) {
        if (X3StringUtils.isEmpty(jsonBean)) {
            return;
        }
        VehicleInfoBean infoBean = new Gson().fromJson(jsonBean,VehicleInfoBean.class);
        if (iOnShowVehicleInfo != null) {
            iOnShowVehicleInfo.iOnShowVehicle(infoBean);
        }
    }

    /**
     * 如果发生导入覆盖数据的话 需要更新一下车辆品牌和车型数据
     * @param carType
     */
    @JavascriptInterface
    public void updateCarType(String carType) {
        if (X3StringUtils.isEmpty(carType)) {
            return;
        }
        UpdateCarTypeBean carTypeBean = new Gson().fromJson(carType,UpdateCarTypeBean.class);
        if (iOnClickUpdateCar != null) {
            iOnClickUpdateCar.iOnClickUpdateCarType(carTypeBean);
        }
    }

    @JavascriptInterface
    public void nativeEditFirstVO(String aloneBean){
        if (X3StringUtils.isEmpty(aloneBean)) {
            return;
        }
        GroundAloneBean aloneBean1 = new Gson().fromJson(aloneBean,GroundAloneBean.class);
        if (iOnClickAlone != null) {
            iOnClickAlone.iOnClickAloneFirst(aloneBean1);
        }
    }

    @JavascriptInterface
    public void shareScreen(String shareScreen) {
        if (iOnShareScreen != null) {
            iOnShareScreen.iOnShareScreenPicture(shareScreen);
        }
    }

    @JavascriptInterface
    public void addShadow(Object obj) {
        if (iOnShowOrHideViewBg != null) {
            iOnShowOrHideViewBg.iOnShowOriHide(true);
        }
    }

    @JavascriptInterface
    public void removeShadow(Object obj) {
        if (iOnShowOrHideViewBg != null) {
            iOnShowOrHideViewBg.iOnShowOriHide(false);
        }
    }

    @JavascriptInterface
    public void jumpToCarProperties(String carId) {
        if (iOnShowCar != null) {
            iOnShowCar.iOnShowCarProperties(carId);
        }
    }

    @JavascriptInterface
    public void downCarProperties(Object obj) {
        if (iOnHideDialog != null) {
            iOnHideDialog.iOnHideDialog();
        }
    }

    @JavascriptInterface
    public void requestCarNumVin(String carNumOrVin) {
        if (iOnRequest != null) {
            iOnRequest.iOnRequestCarNumOrVin(carNumOrVin);
        }
    }

    @JavascriptInterface
    public void popToVCWithNum(int step){
        if (iOnBackWebview != null) {
            iOnBackWebview.iOnBack(step);
        }
    }

    /**
     * 关闭手势返回
     */
    @JavascriptInterface
    public void disableGestures() {
        if (iOnDisable != null) {
            iOnDisable.iOnDisableGestures();
        }
    }

    /**
     * 开启手势返回
     */
    @JavascriptInterface
    public void enableGestures() {
        if (iOnDisable != null) {
            iOnDisable.iOnEnableGestures();
        }
    }

    @JavascriptInterface
    public void tellKeyboardHeight(String h5Height) {
        if (X3StringUtils.isEmpty(h5Height)) {
            return;
        }
        if (!X3StringUtils.isNumber(h5Height)) {
            return;
        }
        if (iOnH5Height != null) {
            iOnH5Height.iOnGetH5Height(Integer.parseInt(h5Height));
        }
    }

    /**
     * 下载图片
     * @param path
     */
    @JavascriptInterface
    public void downLoadFile(String path) {
        if (iOnDownFile != null) {
            iOnDownFile.iOnDownLoadFile(path);
        }
    }

    @JavascriptInterface
    public void jumpToWorkSuccess(String workSuccess) {
        if (iOnClickJumpToSuccess != null) {
            iOnClickJumpToSuccess.iOnClickJumpToSuccess(workSuccess);
        }
    }

    /**
     * 创建新的待办事项
     * @param
     */
    @JavascriptInterface
    public void viewTask(String taskId) {
        if (iOnClickCreateTask != null) {
            iOnClickCreateTask.iOnClickCheckTask(taskId);
        }
    }

    /**
     * 创建新的待办事项
     * @param serviceBase
     */
    @JavascriptInterface
    public void creatNext(String serviceBase) {
        if (iOnClickCreateTask != null) {
            iOnClickCreateTask.iOnClickCreateTask(serviceBase);
        }
    }

    /**
     * 跳转到施工单
     * @param serviceBase
     */
    @JavascriptInterface
    public void jumpToWorkBase(String serviceBase) {
        if (iOnClickJumpWork != null) {
            iOnClickJumpWork.iOnClickJumpToWork(serviceBase);
        }
    }

    @JavascriptInterface
    public void updatePage(String updatePage) {
        if (iOnClickUpdatePage != null) {
            iOnClickUpdatePage.iOnClickUpdatePage(updatePage);
        }
    }

    /**
     * 点击选择门店
     * 购物车点击提交订单
     *
     * @param url
     */
    @JavascriptInterface
    public void jumpToNextWithReload(String url) {
        if (iOnCLickPushReport != null) {
            iOnCLickPushReport.pushReport(url);
        }
    }

    /**
     * 预约到店
     */
    @JavascriptInterface
    public void appointToShop(String appointBean){
        if (iOnClickAppoint != null) {
            iOnClickAppoint.iOnClickJumpAppoint(appointBean);
        }
    }
    /**
     * 详情更改头像之后，跳转到机会，刷新数据
     */
    @JavascriptInterface
    public void refreshCustom() {
        if (iOnClickCRM != null) {
            iOnClickCRM.refreshCustom();
        }
    }

    /**
     * 跳转到聊天页面
     * @param carUserId
     */
    @JavascriptInterface
    public void jumpToMessage(String carUserId,String userName) {
        if (iOnClickMessage != null) {
            iOnClickMessage.iOnJumpToMessage(carUserId,userName);
        }
    }

    /**
     * 标记回访
     */
    @JavascriptInterface
    public void markAfterAsk(String markStr) {
        if (iOnClickVisit != null) {
            iOnClickVisit.iOnClickVisit(markStr);
        }
    }

    /**
     * 赠送余额
     */
    @JavascriptInterface
    public void jumpToBalance(String carOwnerUserId) {
        if (ioClickGiftBalance != null) {
            ioClickGiftBalance.iOClickGiftBalance(carOwnerUserId);
        }
    }
    @JavascriptInterface
    public void createWorkTask(String taskStr) {
        if (iOnClickCreate != null) {
            iOnClickCreate.iOnClickCeateTask(taskStr);
        }
    }

    @JavascriptInterface
    public void popToMainPage(String str) {
        Log.e("popToMainPage", str + "-");
        context.finish();
        context.overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
    }

    @JavascriptInterface
    public void popToMainPage() {
        Log.e("popToMainPage", "-");
        context.finish();
        context.overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
    }

    /**
     * 从保养劵返回
     */
    @JavascriptInterface
    public void couponToOrder(String mapUrl) {
        Log.e("couponToOrder", mapUrl + "--");
        context.finish();
        context.overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
    }

    @JavascriptInterface
    public void sharePopWindow(String json) {
        Log.e("json", json + "--");
        if (iOnClickShareReport != null) {
            iOnClickShareReport.shareReport(json);
        }

    }

    @JavascriptInterface
    public void backReload(final String params) {
        if (iOnBackReload != null) {
            iOnBackReload.iOnBackReload(params);
        }
    }

    @JavascriptInterface
    public void backReport() {
        if (webView == null || context == null) {
            return;
        }
        context.finish();
        context.overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
    }

    @JavascriptInterface
    public void backToRootVC(String params) {
        Log.e("backToRootVC", "backToRootVC" + params);
    }

    @JavascriptInterface
    public void jumpToNextWithReloadCommon(String params) {
        Log.e("jumpToNextCommon", params + "-");

    }

    @JavascriptInterface
    public void jumpToOrderCommon(String mapUrl) {
        Log.e("mapUrl", mapUrl + "-");
        context.finish();
        context.overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
    }

    @JavascriptInterface
    public void carCondition(String carId) {
        Log.e("carCondition", carId + "");
    }

    /**
     * 服务页理的点击 购物车
     *
     * @param url
     */
    @JavascriptInterface
    public void jumpToOrder(String url) {
        Log.e("uurllll", url);
    }

    @JavascriptInterface
    public void savesToOrder() {
        Log.e("saveToOrder", "saveToOrder");
        webView.goBack();
    }

    @JavascriptInterface
    public void saveToOrder(String params) {
        Log.e("saveToOrder", params + "--");

        webView.goBack();

    }

    @JavascriptInterface
    public void jumpToStore(final String shopping_path) {
        Log.e("pathstore", shopping_path + "--");

    }

    @JavascriptInterface
    public void gotoDrive(String path) {
        Log.e("gotoDrive", path + "--");

    }

    @JavascriptInterface
    public void orderToService() {
        Log.e("orderToService", "--");

    }

    @JavascriptInterface
    public void cancelOrderToApp() {
        context.finish();
        context.overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
    }

    @JavascriptInterface
    public void telToTheNum(final String phone) {

        XXPermissions.with(context)
                .permission(Permission.Group.STORAGE)
                .permission(Permission.RECORD_AUDIO)
                .request(new OnPermissionCallback() {
                    @Override
                    public void onGranted(List<String> permissions, boolean all) {
                        if(all){
                            Intent intent = new Intent(Intent.ACTION_DIAL);
                            Uri data = Uri.parse("tel:" + phone);
                            intent.setData(data);
                            context.startActivity(intent);
                        }else {
                            XXPermissions.startPermissionActivity(context, permissions);
                        }
                    }
                    @Override
                    public void onDenied(List<String> permissions, boolean never) {
                        XXPermissions.startPermissionActivity(context, permissions);
                    }
                });

    }


    @JavascriptInterface
    public void getLocation() {
        Log.e("location--", "----");

    }

    @JavascriptInterface
    public void getMap(String map_path) {
        List<String> mapList = new ArrayList<>();
        if (isAvilible("com.autonavi.minimap")) {
            mapList.add("1");
        }
        if (isAvilible("com.baidu.BaiduMap")) {
            mapList.add("2");
        }
        if (isAvilible("com.tencent.map")) {
            mapList.add("3");
        } else {
            //ToastUtils.showShort("请安装第三方地图可导航");
        }

        String mapPath = "";
        for (int i = 0; i < mapList.size(); i++) {
            if (i == 0) {
                mapPath = mapList.get(i);
            } else {
                mapPath = mapPath + "-" + mapList.get(i);
            }
        }
        invokeMap(mapPath);
    }


    @JavascriptInterface
    public void jumpToCustomerService() {


    }

    @JavascriptInterface//maintainCoupon/maintain-advert.html-
    public void jumpToService(String service_path) {

        Log.e("jumpToService", service_path + "-");


    }

    @JavascriptInterface
    public void jumpToOrderDetails(String url) {
        Log.e("jumpToOrderDetails", url);
        //webView.loadUrl(Constent.SERVICE_URL + url);


    }

    @JavascriptInterface
    //T https://dev.bbavip.online/carowner/api-v1/personage/listWorkBase?receiveBaseId=3414
    public void workRecord(String carId) {
        Log.e("workRecord", carId + "-");

    }


    @JavascriptInterface
    public void jumpToViewOrder(String service_path) {

    }

    @JavascriptInterface
    public void accessDenied(int code) {
        Log.e("accessDenid", code + "-");

    }

    @JavascriptInterface
    public void gotoLive(String str) {
        Log.e("gotoLive", str + "-");
        if (iOnCLickPushReport != null) {
            iOnCLickPushReport.pushReport(str);
        }
    }

    @JavascriptInterface
    public void morePicture(String url) {
        Log.e("gotoLive", url + "-");
        if (iOnCLickPushReport != null) {
            iOnCLickPushReport.pushReport(url);
        }
//        Intent intent = new Intent(context, WebImgActivity.class);
//        intent.putExtra("url", url);
//        context.startActivity(intent);

    }

    @JavascriptInterface
    public void pushWorkCord(String carId) {
        Log.e("pushWork", carId + "--");
//        Intent intent = new Intent(context, WorkDetailActivity.class);
//        intent.putExtra("carId", carId);
//        context.startActivity(intent);

    }

    //pushWork
    @JavascriptInterface
    public void pushReport(String url) {
        Log.e("pushreport", url);
        if (iOnCLickPushReport != null) {
            iOnCLickPushReport.pushReport(url);
        }
//        Intent intent = null;
//        if (url != null && url.contains("report-index")) {
//            intent = new Intent(context, ReportDetailActivity.class);
//        } else if (url != null && url.contains("sureReturnDriving")) {
//            intent = new Intent(context, ReportServiceSureActivity.class);
//        } else {
//            intent = new Intent(context, ReportCheckActivity.class);
//        }
//        intent.putExtra("url", url);
//        context.startActivity(intent);
    }

    @JavascriptInterface
    public void toAndroidUrl(String map_path) {
        Intent intent = new Intent();
        intent.setData(Uri.parse(map_path));
        context.startActivity(intent);
    }

    @JavascriptInterface
    public void goToFriends() {
//        Intent intent = new Intent(context, MainActivity.class);
//        intent.putExtra("current", 2);
//        context.startActivity(intent);
//        context.finish();
    }


    @JavascriptInterface
    public void goToCarVpFragment(String state) {
        //JS调用android本地方法，返回到客户列表页面，移除对应的数据
        if(state.equals("true")){
            X3ToastUtils.showMessage(context.getString(R.string.x3_give_you_visit_success));
        }else {
            X3ToastUtils.showMessage(context.getString(R.string.x3_cancel_you_visit_success));
        }
        EventBus.getDefault().post(new CrmVpSumEvenBus());
        DeleteFriends deleteFriends = new DeleteFriends("REFRESH_GROUND");
        EventBus.getDefault().post(deleteFriends);
        context.finish();

    }

    @JavascriptInterface
    public void addMaintainPlan(String data){
        if(iOnAddPlan != null){
            CarIdinfoBean carIdinfoBean = new Gson().fromJson(data, CarIdinfoBean.class);
            iOnAddPlan.iOnAddPlan(carIdinfoBean.carId);
        }
    }

    /**
     * 检查手机上是否安装了指定的软件
     *
     * @param packageName：应用包名
     * @return
     */
    private boolean isAvilible(String packageName) {
        //获取packagemanager
        final PackageManager packageManager = context.getPackageManager();
        //获取所有已安装程序的包信息
        List<PackageInfo> packageInfos = packageManager.getInstalledPackages(0);
        //用于存储所有已安装程序的包名
        List<String> packageNames = new ArrayList<String>();
        //从pinfo中将包名字逐一取出，压入pName list中
        if (packageInfos != null) {
            for (int i = 0; i < packageInfos.size(); i++) {
                String packName = packageInfos.get(i).packageName;
                packageNames.add(packName);
            }
        }
        //判断packageNames中是否有目标程序的包名，有TRUE，没有FALSE
        return packageNames.contains(packageName);
    }

    @JavascriptInterface
    public void goToEvaluationWithJsonString(String path) {
        Log.e("goToEvaluationWith", path);
//        Intent intent = new Intent(context, EvaluateActivity.class);
//        intent.putExtra("path", path);
//        context.startActivity(intent);
    }
    //日均里程弹窗
    @JavascriptInterface
    public void updataCarDayMiles(String jsonBean){
        if (X3StringUtils.isEmpty(jsonBean)) {
            return;
        }
        HomeChangeMilesBean homeChangeMilesBean = new Gson().fromJson(jsonBean, HomeChangeMilesBean.class);
        if(homeChangeMilesBean == null){
            return;
        }
        if(iOnShowHomeChangeDialog != null){
            iOnShowHomeChangeDialog.iOnShowHomechangeDialog(Integer.parseInt(homeChangeMilesBean.currentMiles),homeChangeMilesBean.productionDate,homeChangeMilesBean.customSet,homeChangeMilesBean.perMiles);
        }
    }

    @TargetApi(Build.VERSION_CODES.KITKAT)
    public void invokeMap(final String map) {
        context.runOnUiThread(() -> webView.evaluateJavascript("window.getMapType(\"" + map + "\")", value -> {}));
    }

    public interface IOnCLickPushReport {
        void pushReport(String url);
    }

    IOnClickCRM iOnClickCRM;

    public void setiOnClickCRM(IOnClickCRM iOnClickCR) {
        this.iOnClickCRM = iOnClickCR;
    }

    public interface IOnClickCRM {
        void refreshCustom();
    }

    IOnClickMessage iOnClickMessage;

    public void setiOnClickMessage(IOnClickMessage iOnClickMessage) {
        this.iOnClickMessage = iOnClickMessage;
    }

    public interface IOnClickMessage {
        void iOnJumpToMessage(String carUserId,String userName);
    }

    IOnClickCreate iOnClickCreate;

    public void setiOnClickCreate(IOnClickCreate iOnClickCreate) {
        this.iOnClickCreate = iOnClickCreate;
    }

    public interface IOnClickCreate{
        void iOnClickCeateTask(String taskStr);
    }

    IOnClickVisit iOnClickVisit;

    public void setiOnClickVisit(IOnClickVisit iOnClickVisit) {
        this.iOnClickVisit = iOnClickVisit;
    }

    public interface IOnClickVisit {
        void iOnClickVisit(String markStr);
    }

    IOClickGiftBalance ioClickGiftBalance;
    public void setiOnClickGiftBalance(IOClickGiftBalance iOnClickGiftBalan) {
        this.ioClickGiftBalance = iOnClickGiftBalan;
    }

    public interface IOClickGiftBalance {
        void iOClickGiftBalance(String carUserId);
    }

    IOnClickAppoint iOnClickAppoint;

    public void setiOnClickAppoint(IOnClickAppoint iOnClickAppoint) {
        this.iOnClickAppoint = iOnClickAppoint;
    }

    public interface IOnClickAppoint {
        void iOnClickJumpAppoint(String appointBean);
    }

    public IOnCLickPushReport getiOnCLickPushReport() {
        return iOnCLickPushReport;
    }

    public void setiOnCLickPushReport(IOnCLickPushReport iOnCLickPushReport) {
        this.iOnCLickPushReport = iOnCLickPushReport;
    }

    public interface IOnClickShareReport {
        void shareReport(String json);
    }

    public IOnClickShareReport getiOnClickShareReport() {
        return iOnClickShareReport;
    }

    public void setiOnClickShareReport(IOnClickShareReport iOnClickShareReport) {
        this.iOnClickShareReport = iOnClickShareReport;
    }

    public interface IOnClickReturnListener {
        void backReport();
    }

    public void setiOnClickReturnListener(IOnClickReturnListener iOnClickReturnListener) {
        this.iOnClickReturnListener = iOnClickReturnListener;
    }

    IOnClickJumpWork iOnClickJumpWork;

    public void setiOnClickJumpWork(IOnClickJumpWork iOnClickJumpWork) {
        this.iOnClickJumpWork = iOnClickJumpWork;
    }

    public interface IOnClickJumpWork {
        void iOnClickJumpToWork(String serviceBase);
    }

    IOnClickCreateTask iOnClickCreateTask;

    public void setiOnClickCreateTask(IOnClickCreateTask iOnClickCreateTask) {
        this.iOnClickCreateTask = iOnClickCreateTask;
    }

    public interface IOnClickCreateTask {
        void iOnClickCreateTask(String serviceBase);

        void iOnClickCheckTask(String taskId);
    }

    IOnClickJumpToSuccess iOnClickJumpToSuccess;

    public void setiOnClickJumpToSuccess(IOnClickJumpToSuccess iOnClickJumpToSuccess) {
        this.iOnClickJumpToSuccess = iOnClickJumpToSuccess;
    }

    public interface IOnClickJumpToSuccess {
        void iOnClickJumpToSuccess(String jumpSuccess);
    }

    IOnClickUpdatePage iOnClickUpdatePage;

    public void setiOnClickUpdatePage(IOnClickUpdatePage iOnClickUpdatePage) {
        this.iOnClickUpdatePage = iOnClickUpdatePage;
    }

    public interface IOnClickUpdatePage {
        void iOnClickUpdatePage(String jumpSuccess);
    }

    IOnDownFile iOnDownFile;

    public void setiOnDownFile(IOnDownFile iOnDownFile) {
        this.iOnDownFile = iOnDownFile;
    }

    public interface IOnDownFile {
        void iOnDownLoadFile(String path);
    }

    IOnH5Height iOnH5Height;

    public void setiOnH5Height(IOnH5Height iOnH5Height) {
        this.iOnH5Height = iOnH5Height;
    }

    public interface IOnH5Height {
        void iOnGetH5Height(int h5Height);
    }

    IOnDisable iOnDisable;

    public void setiOnDisable(IOnDisable iOnDisable) {
        this.iOnDisable = iOnDisable;
    }

    public interface IOnDisable {
        void iOnDisableGestures();

        void iOnEnableGestures();
    }

    IOnBackWebview iOnBackWebview;

    public void setiOnBackWebview(IOnBackWebview iOnBackWebview) {
        this.iOnBackWebview = iOnBackWebview;
    }

    public interface IOnBackWebview {
        void iOnBack(int step);
    }

    IOnRequest iOnRequest;

    public void setiOnRequest(IOnRequest iOnRequest) {
        this.iOnRequest = iOnRequest;
    }

    public interface IOnRequest {
        void iOnRequestCarNumOrVin(String carNumOrVin);
    }

    IOnShowCar iOnShowCar;

    public void setiOnShowCar(IOnShowCar iOnShowCar) {
        this.iOnShowCar = iOnShowCar;
    }

    public interface IOnShowCar{
        void iOnShowCarProperties(String carId);
    }

    IOnHideDialog iOnHideDialog;

    public void setiOnHideDialog(IOnHideDialog iOnHideDialog) {
        this.iOnHideDialog = iOnHideDialog;
    }

    public interface IOnHideDialog{
        void iOnHideDialog();
    }

    IOnShowOrHideViewBg iOnShowOrHideViewBg;

    public void setiOnShowOrHideViewBg(IOnShowOrHideViewBg iOnShowOrHideViewBg) {
        this.iOnShowOrHideViewBg = iOnShowOrHideViewBg;
    }

    public interface IOnShowOrHideViewBg{
        void iOnShowOriHide(boolean show);
    }

    IOnShareScreen iOnShareScreen;

    public void setiOnShareScreen(IOnShareScreen iOnShareScreen) {
        this.iOnShareScreen = iOnShareScreen;
    }

    public interface IOnShareScreen {
        void iOnShareScreenPicture(String shareScreen);
    }

    IOnClickAlone iOnClickAlone;

    public void setiOnClickAlone(IOnClickAlone iOnClickAlone) {
        this.iOnClickAlone = iOnClickAlone;
    }

    public interface IOnClickAlone {
        void iOnClickAloneFirst(GroundAloneBean aloneBean);
    }

    IOnClickUpdateCar iOnClickUpdateCar;

    public void setiOnClickUpdateCar(IOnClickUpdateCar iOnClickUpdateCar) {
        this.iOnClickUpdateCar = iOnClickUpdateCar;
    }

    public interface IOnClickUpdateCar {
        void iOnClickUpdateCarType(UpdateCarTypeBean carTypeBean);
    }

    IOnShowVehicleInfo iOnShowVehicleInfo;

    public void setiOnShowVehicleInfo(IOnShowVehicleInfo iOnShowVehicleInfo) {
        this.iOnShowVehicleInfo = iOnShowVehicleInfo;
    }

    public interface IOnShowVehicleInfo {
        void iOnShowVehicle(VehicleInfoBean infoBean);
    }

    IOnBackReload iOnBackReload;

    public void setiOnBackReload(IOnBackReload iOnBackReload) {
        this.iOnBackReload = iOnBackReload;
    }

    public interface IOnBackReload {
        void iOnBackReload(String params);
    }

    IOnShowToDueDate iOnShowToDueDate;

    public void setiOnShowToDueDate(IOnShowToDueDate iOnShowToDueDate) {
        this.iOnShowToDueDate = iOnShowToDueDate;
    }

    public interface IOnShowToDueDate {
        void iOnShowGetToDueDate(MileOrTimeBean mileOrTimeBean);
    }

    IOnShowCarBind iOnShowCarBind;

    public void setiOnShowCarBind(IOnShowCarBind iOnShowCarBind) {
        this.iOnShowCarBind = iOnShowCarBind;
    }

    public interface IOnShowCarBind {
        void iOnShowCarBindInfo(GroundPushBean pushBean);
    }

    IOnShowCarPicCut iOnShowCarPicCut;

    public void setiOnShowCarPicCut(IOnShowCarPicCut iOnShowCarPicCut) {
        this.iOnShowCarPicCut = iOnShowCarPicCut;
    }

    public interface IOnShowCarPicCut{
        void iOnShowCarPicCut(GroundPushBean pushBean);
    }

    IOnShowAlone iOnShowAlone;

    public void setiOnShowAlone(IOnShowAlone iOnShowAlone) {
        this.iOnShowAlone = iOnShowAlone;
    }

    public interface IOnShowAlone {
        void iOnShowAloneCar(String jsonBean);
    }

    IOnShowSaveCommun iOnShowSaveCommun;

    public void setiOnShowSaveCommun(IOnShowSaveCommun iOnShowSaveCommun) {
        this.iOnShowSaveCommun = iOnShowSaveCommun;
    }

    public interface IOnShowSaveCommun {
        void iOnShowSaveCommun(int carowneruserCommunicationId);
    }

    IOnInputContent iOnInputContent;

    public void setiOnInputContent(IOnInputContent iOnInputContent) {
        this.iOnInputContent = iOnInputContent;
    }

    public interface IOnInputContent {
        void iOnInputContent(InputBean pushBean);
    }

    IOnShowHeaderColor iOnShowHeaderColor;

    public void setiOnShowHeaderColor(IOnShowHeaderColor iOnShowHeaderColor) {
        this.iOnShowHeaderColor = iOnShowHeaderColor;
    }

    public interface IOnShowHeaderColor{
        void iOnShowHeaderColor(String color);
    }
    IOnShowHomeChangeDialog iOnShowHomeChangeDialog;
    public interface IOnShowHomeChangeDialog {
        void iOnShowHomechangeDialog(int totalMile, String modelTime, boolean customSet, String permile );
    }

    public void setiOnShowHomeChangeDialog(IOnShowHomeChangeDialog iOnShowHomeChangeDialog) {
        this.iOnShowHomeChangeDialog = iOnShowHomeChangeDialog;
    }

    IOnUpdateVehicleInfo iOnUpdateVehicleInfo;

    public X3AndroidJAInteface setiOnUpdateVehicleInfo(IOnUpdateVehicleInfo iOnUpdateVehicleInfo) {
        this.iOnUpdateVehicleInfo = iOnUpdateVehicleInfo;
        return this;
    }

    public interface IOnUpdateVehicleInfo {
        void iUpdateVehicleInfo();
    }

    IOnUpdateWorkList iOnUpdateWorkList;

    public X3AndroidJAInteface setiOnUpdateWorkList(IOnUpdateWorkList iOnUpdateWorkList) {
        this.iOnUpdateWorkList = iOnUpdateWorkList;
        return this;
    }

    public interface IOnUpdateWorkList {
        void iUpdateWorkList();
    }

    IOnEditPlan iOnEditPlan;

    public X3AndroidJAInteface setiOnEditPlan(IOnEditPlan iOnEditPlan) {
        this.iOnEditPlan = iOnEditPlan;
        return this;
    }

    public interface IOnEditPlan {
        void iOnEditPlan(String json);
    }


    IOnAddPlan iOnAddPlan;

    public X3AndroidJAInteface setiOnAddPlan(IOnAddPlan iOnAddPlan) {
        this.iOnAddPlan = iOnAddPlan;
        return this;
    }

    public interface IOnAddPlan {
        void iOnAddPlan(long json);
    }

    IOnShareWork iOnShareWork;

    public X3AndroidJAInteface setiOnShareWork(IOnShareWork iOnShareWork) {
        this.iOnShareWork = iOnShareWork;
        return this;
    }

    public interface IOnShareWork {
        void iOnShareWork(String json);
    }

    IOnRefreshLoad iOnRefreshLoad;

    public X3AndroidJAInteface setiOnRefreshLoad(IOnRefreshLoad iOnRefreshLoad) {
        this.iOnRefreshLoad = iOnRefreshLoad;
        return this;
    }

    public interface IOnRefreshLoad {
        void iOnRefreshLoad();
    }

    IOnLivePlayBack iOnLivePlayBack;

    public X3AndroidJAInteface setIOnLivePlayBack(IOnLivePlayBack iOnLivePlayBack) {
        this.iOnLivePlayBack = iOnLivePlayBack;
        return this;
    }

    public interface IOnLivePlayBack {
        void iOnLivePlayBack(int roomId);
    }

}
